<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
    <script src="https://unpkg.com/vue@next"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

</head>
<body>
<div id="app">
    显示 /hello3 请求的返回值
    {{ info }}
</div>
<script type = "text/javascript">
const app = {
  data () {
    return {
      info: 'Ajax demo'
    }
  },
  mounted () {
        axios.post('/hello3', {
            name: 'Tom',        // 参数 name
            age: '18'    // 参数 age
          })
          .then(response => (this.info = response.data))
          .catch(function (error) {
            console.log(error);
          });
          }
}
Vue.createApp(app).mount('#app')
</script>
</body>
</html>